/*
*******************************************************************************
COPYRIGHT 2010 Atech-Automotive
Source File Name : uds_diag_read_write_fun.h
Group            : ATECH
Author           : 
Date First Issued:    
********************************Documentation**********************************
General Purpose - This file contains the function for diag request service.
********************************RevisionHistory********************************
_______________________________________________________________________________
Date : MM/DD/YY                       Release : V1.0
Date : 05/10/2010              diag request services function

******************************************************************************/

#ifndef _UDS_DIAG_READ_WRITE_FUN_H_
#define _UDS_DIAG_READ_WRITE_FUN_H_

/* #include */
#include "system.h"

#pragma CODE_SEG  OTHER_ROM

/*Read Write Data By Identifier*/
#define	RD_Bootloader_SoftwareNumber_DID                             ((UINT16)0xF183)
#define	RD_WR_Application_fingerprint_DID                             ((UINT16)0xF184)
#define	RD_System_Supplier_ECU_SoftwareNumber_DID                     ((UINT16)0xF187)
#define	RD_SupplierIdentifierDataIdentifier_DID                       ((UINT16)0xF18A)
#define RD_WR_VehicleIdentificationNumber_DID                         ((UINT16)0xF190)
#define RD_VehicleManufacturerECUHwVersionNumber_DID                  ((UINT16)0xF191)
#define	RD_SystemSupplierECUSoftwareVersionNumberDataIdentifier_DID   ((UINT16)0xF195)


/*Read Data Function */
extern UINT8 Read_Bootloader_SoftwareNumber                                              ( UINT8 *p_u8_data, UINT8 u8_length );  //0xF183
extern UINT8 Read_Application_fingerprint                                               ( UINT8 *p_u8_data, UINT8 u8_length );  //0xF184
extern UINT8 Read_System_Supplier_ECU_SoftwareNumber                                          ( UINT8 *p_u8_data, UINT8 u8_length );  //0xF187
extern UINT8 Read_SupplierIdentifierDataIdentifier                                             ( UINT8 *p_u8_data, UINT8 u8_length );  //0xF18A
extern UINT8 Read_VehicleIdentificationNumber                                               ( UINT8 *p_u8_data, UINT8 u8_length );  //0xF190
extern UINT8 Read_VehicleManufacturerECUHwVersionNumber                                             ( UINT8 *p_u8_data, UINT8 u8_length );  //0xF191
extern UINT8 Read_SysSupplierECUSoftwareVNIdentifier                                                    ( UINT8 *p_u8_data, UINT8 u8_length );  //0xF195


#define DIAG_DID_READ_TABLE \
{RD_Bootloader_SoftwareNumber_DID,                                             S0, 10, Read_Bootloader_SoftwareNumber}, \
{RD_WR_Application_fingerprint_DID,                                              S0, 9,  Read_Application_fingerprint}, \
{RD_System_Supplier_ECU_SoftwareNumber_DID,                                         S0, 9,  Read_System_Supplier_ECU_SoftwareNumber}, \
{RD_SupplierIdentifierDataIdentifier_DID,                                            S0, 10,  Read_SupplierIdentifierDataIdentifier}, \
{RD_WR_VehicleIdentificationNumber_DID,                                              S0, 17,  Read_VehicleIdentificationNumber}, \
{RD_VehicleManufacturerECUHwVersionNumber_DID,                                            S0, 9,  Read_VehicleManufacturerECUHwVersionNumber}, \
{RD_SystemSupplierECUSoftwareVersionNumberDataIdentifier_DID,                                                   S0, 9,  Read_SysSupplierECUSoftwareVNIdentifier}, \


/*Write Data Function */
extern UINT8 WR_Application_fingerprint                        ( UINT8 *p_u8_data, UINT8 u8_length );
extern UINT8 WR_VehicleIdentificationNumber                                    ( UINT8 *p_u8_data, UINT8 u8_length );


#define DIAG_DID_WRITE_TABLE   \
{RD_WR_Application_fingerprint_DID,                                              S0, 9,  WR_Application_fingerprint}, \
{RD_WR_VehicleIdentificationNumber_DID,                                          S0, 17,  WR_VehicleIdentificationNumber}, \

#pragma CODE_SEG DEFAULT

/******************************************************************************/
#endif
